<!DOCTYPE html>
<html
  layout:decorator="components/layout"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  xmlns:th="http://www.thymeleaf.org"
>
<head>
  <title>管理员列表</title>
</head>
<body>
<div
  layout:fragment="content"
  class="container"
  id="app" v-cloak
>
  <!--引入边框角-->
  <div class="container">
    <div class="myHeader">
      <div class="myHeader-title">
        用户列表
      </div>
      <div class="myHeader-tool">
        <el-form inline label-width="80px">
          <el-form-item label="登录名:">
            <el-input
              size="mini"
              v-model="form.loginName"
              placeholder="查找"
              name="keyword"
            ></el-input>
          </el-form-item>
          <el-form-item label-width="0px">
            <el-button
              size="mini"
              @click="searchPage"
              icon="el-icon-search"
            ></el-button>
          </el-form-item>
          <el-form-item label="管理员组:">
            <el-select
              size="mini"
              v-model="form.userType"
              :map="userTypeMap"
              @change="searchPage"
            >
              <el-option v-for="[key,val] in userTypeMap" :label="val" :value="key" :key="key"></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
    </div>
    <!--内容-->
    <my-table
      :data="page.records"
      :columns="columns"
      @handle-selection-change="selection"
    >
      <template #sys_user_role_list="row">
        <div v-for="sysUserRole in row.row.sysUserRoleList">
          {{fieldFormatter.generator(sysRoleMap)(sysUserRole.roleId)}}
        </div>
      </template>
      <template #reg_mail="scope">
        <a
          href="#"
          @click.stop.prevent="updateSysUser(scope.row)"
        >{{scope.row.regMail}}</a>
      </template>
      <template #operating="scope">
        <span>
          <el-button
            size="mini"
            v-realm="'system-configuration:sys-user:edit'"
            @click="updateSysUser(scope.row)"
            type="primary"
          >编辑
        </el-button>
        </span>

        <span>
          <el-button
            size="mini"
            v-realm="'system-configuration:sys-user:edit'"
            @click="deleteSysUser(scope.row.id)"
            type="danger"
          >删除
        </el-button>
        </span>

      </template>
    </my-table>
    <div class="pagination">
      <el-pagination
        background
        @size-change="changeSize"
        @current-change="goto"
        :current-page="page.current"
        :page-sizes="[10, 20, 30]"
        :page-size="page.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page.total"
      >
      </el-pagination>
    </div>
  </div>
</div>
<div layout:fragment="js">
  <script src="/static/js/module/system-config/model/SysUser.js"></script>
  <script src="/static/js/module/system-config/api/sysRoleApi.js"></script>
  <script src="/static/js/module/system-config/api/sysUserApi.js"></script>
  <script src="/static/js/module/system-config/admin_privilege_admin_list.js"></script>
</div>
</body>
</html>
